import React from "react";
import {Button, Divider} from "antd";


interface PredicateButtonProp {
    show : boolean
    children : React.ReactNode | string | number
    onClick : () => void
}

export const PredicateButton = ( { show , children , onClick } : PredicateButtonProp ) => {
    return show ? <Button onClick={ onClick }> { children as any } </Button> : <></>
}

interface LabelPredicateButtonProp extends PredicateButtonProp{

    label : string
}


export const LabelPredicateButton = ( {  label , show , children , onClick } : LabelPredicateButtonProp ) => {
    return <>
        { label } <Divider type="vertical"></Divider> <PredicateButton show={show} onClick={ onClick } children={children} />
    </>
}